package cn.geminis.auth.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.security.authentication.event.AbstractAuthenticationFailureEvent;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class AuthenticationEvents {
    @EventListener
    public void onFailure(AbstractAuthenticationFailureEvent failureEvent) {
        log.warn("认证服务异常。认证信息：{}", failureEvent.getAuthentication(), failureEvent.getException());
    }
}
